﻿ @model BlackBox.Controllers.AccountViewModel
@{
    ViewBag.Title = "Profile";
}

<div id="profile">
    <div id="profile-information">
        @Html.Partial("_UserPartialView", Model.UserData)
    </div>
    <div id="profile-statistics">

        <table>
            <caption>Scores</caption>
            <thead>
                <tr>
                    <th> Game name </th>
                    <th> Score </th>
                    <th> Wins/Losses </th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td></td>
                    <td id="my-invite"></td>
                    <td></td>
                </tr> 
            </tbody>      
        </table>

        @Html.Partial("_GroupPartialView", Model.GroupListData)

    </div>
    <img src="@Model.UserData.Img" alt="UserPhoto" />

    @if(Model.UserData.UserName == User.Identity.Name && Model.InviteListData != null)
    {
        <h5>Invites</h5>
        <ul>
            @foreach(var invite in Model.InviteListData)
            {
                if(invite.GroupID != null && invite.GroupID != 0)
                {
                    <li>
                        @Html.ActionLink("Accept Group Invite", "AcceptGroupInvite", new{groupID = invite.GroupID})
                    </li>
                }
                if(invite.GameID != null && invite.GameID != 0)
                {
                    <li>
                        @Html.ActionLink("Accept Game Invite", "AcceptGameInvite", new{gameID = invite.GameID})
                    </li>
                }
            }
        </ul>
    }
            
</div>

